package com.example.tijianbackend.controller;

import com.example.tijianbackend.pojo.Hospital;
import com.example.tijianbackend.result.Result;
import com.example.tijianbackend.service.HospitalService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;

/**
 * @author: bong~
 * @description: TODO
 * @date: 2024/6/14 13:57
 * @version: 1.0
 */

@RestController
@Slf4j
@RequestMapping("/hospital")
@Api(tags ="hospital")
@CrossOrigin("*")
public class HospitalController {

    @Autowired
    private HospitalService hospitalService;

    @GetMapping("/list")
    public Result getHospitalList(){

        List<Hospital> list=hospitalService.list();

        return Result.success(list);
    }
}
